<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>新建文章</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/resources/bootstrap/css/bootstrap.min.css">
    <link href="<%=request.getContextPath() %>/resources/css/createnewmessage.css" rel="stylesheet">
    
    <script src="<%=request.getContextPath() %>/resources/jquery/jquery-1.11.3.min.js"></script>
	<script src="<%=request.getContextPath() %>/resources/bootstrap/js/bootstrap.min.js"></script>
	<script src="<%=request.getContextPath() %>/resources/js/createnewmessage.js"></script>	
	<script type="text/javascript" src="https://unpkg.com/wangeditor/release/wangEditor.min.js"></script>
	<script src="<%=request.getContextPath() %>/resources/layer/layer.js"></script>	
	<link href="<%=request.getContextPath() %>/resources/img/tea.png" rel="icon">
</head>
<script>
$(function(){
	var type = '${message.messageType}';
	if(type != ''){
		$("span[name='selectMessageType']").each(function(){
			if($(this).attr('value') == type){
				$(this).attr('class','label label-success');
			}else{
				$(this).attr('class','label label-default');
			}
		})
		messageType = type;
	}
	messageId = '${message.newmessage_id}';
	
	
})
</script>
<body class="hold-transition skin-blue sidebar-mini"  style="background-image: linear-gradient(to top, #fff,#30A12B); height: 965px;">
<input id="usersequence" type="text" value='<%=session.getAttribute("usersequence") %>' hidden>

	<jsp:include page="/WEB-INF/jsp/menu.jsp" />

<div class="container col-sm-12">
	<div class="form row" >
		<div id="queryallDiv"  style="text-align:center">
			<div class="form-group">
				<label class="control-label col-sm-2">标题</label>
			  	<div class="col-sm-10 ">
	        		<input type="text" class="form-control" id="title" value="${message.newmessage_title}" placeholder="TITLE" style="width:300px">
				</div>
			</div>
			<div class="form-group" >
				<label class="control-label col-sm-2">作者</label>
			  	<div class="col-sm-10 ">
	        		<input type="text" class="form-control" id="author" value="${message.newmessage_author}" placeholder="AUTHOR" style="width:300px">
				</div>
			</div>
			 <div class="form-group">
			  		<label class="col-sm-2 control-label">文章类型</label>
			  		<div class="col-sm-10 ">
			  			<span class="label label-default" name="selectMessageType" value="1" onclick="inputValue(1)">生活</span>&nbsp;&nbsp;
						<span class="label label-default" name="selectMessageType" value="2" onclick="inputValue(2)">心得</span>&nbsp;&nbsp;
						<span class="label label-default" name="selectMessageType" value="3" onclick="inputValue(3)">交流</span>&nbsp;&nbsp;
						<span class="label label-default" name="selectMessageType" value="4" onclick="inputValue(4)">详情</span>&nbsp;&nbsp;
						<span class="label label-default" name="selectMessageType" value="5" onclick="inputValue(5)">其他</span>
					</div>
			 </div>
			<div class="form-group" >
			
				<div id="editor" class="col-sm-12">
					${message.newmessage_content}
				</div>		
			</div>
			<div class="form-group">
				<div class="col-sm-4" align="left">
	                 <input type="button" value="提交" id="addBtn" class="btn btn-success" style="width: 100px">
	            </div>
			</div>
		</div>
	</div>
</div>



</body>
<script type="text/javascript">
         var E = window.wangEditor
        var editor = new E('#editor')
        // 或者 var editor = new E( document.getElementById('editor') )
    
		editor.customConfig.uploadImgShowBase64 = true

        editor.create()
    </script>
</html>
